package com.kjsb.service.impl;

import com.kjsb.dao.ExpertDao;
import com.kjsb.entity.Expert;
import com.kjsb.service.ExpertService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ExpertServiceImpl implements ExpertService {
    @Autowired
    private ExpertDao expertDao;

    @Override
    public List<Expert> getAllExperts() {
        return expertDao.selectList(null);
    }

    @Override
    public boolean deleteExperts(Integer id) {
        expertDao.deleteById(id);
        return true;
    }

    @Override
    public boolean updateExperts(Expert expert) {
        expertDao.updateById(expert);
        return true;
    }

    @Override
    public Expert getByEId(Integer id) {
        return expertDao.selectById(id);
    }
}
